<template>
  <div>
    <div class="title">我的关注</div>
    <div class="list">
      <div class="col" v-for="item in list" :key="item.id">
        <div class="item">
          <div class="imgDiv"><img :src="item.avatar" /></div>
          <div class="content">
            <div class="name">{{ item.nickname }}</div>
            <div class="text">111</div>
          </div>
        </div>
      </div>
    </div>
    <pagination
      :total="total"
      :currentPage="page"
      :pageSize="rows"
      @handleCurrentChange="handleCurrentChange"
    />
  </div>
</template>

<script>
export default {
  name: "NavBar",
  data() {
    return { page: 1, total: 0, list: [], rows: 10 };
  },
  components: {
    pagination: () => import("@/components/pagination.vue"),
  },
  mounted() {
    this.getList();
  },
  methods: {
    getList() {
      this.$post("/user/follow_list", {
        page: this.page,
        rows: this.rows,
      }).then((res) => {
        this.list = res.data.data;
        this.total = res.data.total;
      });
    },
    handleCurrentChange(e) {
      this.page = e;
      this.getList();
    },
  },
};
</script>

<style scoped lang="scss">
.title {
  font-size: 24px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  padding: 6px 0 10px;

  .col {
    padding: 5px;
    .item {
      font-size: 16px;
      line-height: 30px;
      padding: 0 15px;
      background: #f8f8f8;
      border-radius: 4px;
      color: #565656;
    }
    .active {
      color: #fff;
      background: #917bbd;
    }
  }
}
.list {
  margin: -15px -10px;
  display: flex;
  flex-wrap: wrap;

  .col {
    padding: 15px 10px;
    width: calc(100% / 3);
    .item {
      border: 1px solid #3c3b8b;
      .imgDiv {
        height: 270px;
      }
      .content {
        padding: 15px;
      }
      .name {
        font-size: 18px;
      }
      .text {
        font-size: 14px;
        color: #999;
      }
    }
  }
}
@media screen and (max-width: 768px) {
}
</style>
